/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task09.task0906;

/* 
记录堆栈跟踪
*/

public class Solution {
    public static void main(String[] args) {
        log("在 main 方法中");
    }

    public static void log(String s) {
        //在此编写你的代码
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        StackTraceElement stackTraceElement = stackTrace[2];
        System.out.println(
                stackTraceElement.getClassName()
                        + ": "
                        + stackTraceElement.getMethodName()
                        + ": "
                        + s
        );
    }
}
